import request from '@/utils/request'

/*
相关的API请求函数
*/
const api_name = '/auth/room'

const api_name2 = "/auth/family"

export default {

  /**
   * 获取家庭列表
   */
  getFamilyList(){
    return request({
      url:  `${api_name2}/getFamilyList`,
      method: 'get'
    })
  },

  /*
  通过id获取
  */
  getCompanyById(id) {
    return request({
      url: `${api_name}/get/${id}`,
      method: 'get'
    })
  },

  /*
  删除一个
  */
  removeById(id) {
    return request({
      url: `${api_name}/remove/${id}`,
      method: "delete"
    })
  },

  /*
  保存一个
  */
  save(company) {
    return request({
      url: `${api_name}/save`,
      method: "post",
      data: company
    })
  },

  /*
  更新一个
  */
  updateById(company) {
    return request({
      url: `${api_name}/update`,
      method: "put",
      data: company
    })
  },

  getPageList(page, limit, searchObj) {
    return request({
      url: `${api_name}/${page}/${limit}`,
      method: 'get',
      params: searchObj // url查询字符串或表单键值对
    })
  },

    //批量删除
    batchRemove(idList) {
        return request({
            url: `${api_name}/batchRemove`,
            method: 'delete',
            data: idList
        })
    },
}